package com.honey.comment.grammer.colon;

import java.util.regex.Matcher;

import com.honey.core.utils.EmptyUtility;

/**
 * 获取实体
 * @author Administrator
 * 
 */
public class MatchEntityName implements MatchItem{
	
	/** 实体名称 */
	private String entityName = null;
	
	@Override
	public boolean match(String item ){
		boolean answer =false ; 
		Matcher matcher = PATTERN_ENTITY_NAME.matcher(item);
		answer = matcher.find();
		if( answer ){
			entityName = item.substring(matcher.end(), item.length());
			answer =! EmptyUtility.isStringEmpty(entityName); 
			if( !answer ){
				entityName = null;
			}
		}
		return answer;
	}
	
	@Override
	public String getValue() {
		return entityName;
	}
}
